/* Ethernet Layer 2 parser public interface */

/* Copyright (C) 2009-2011 David Zanetti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#define ETHER_H

/* return the ethernet type field from the packet */
uint16_t ether_type(void *pkt);

/* return a pointer into the packet for the payload */
uint8_t *ether_payload(uint8_t *pkt);

/* copy the source into the destination, and set source as us */
uint8_t ether_reply(uint8_t *old, uint8_t *newpkt);

/* is this packet a broadcast packet really? */
uint8_t ether_isbroadcast(uint8_t *pkt);

/* main ethernet processing loop */
void ether_process(void);

/* send an arbitrary slot to the given MAC address. This automatically inserts our source MAC */
uint8_t ether_send(uint8_t *dest_mac, uint16_t type, uint8_t slot);

